package com.nothingboard.common.util;

import java.util.HashMap;

public class NtbMap<K,V> extends HashMap<K,V> {
	
	private static final long serialVersionUID = 7846531812032947917L;
	
	public NtbMap(){
		super();
	}
	public String getString(Object key){
		return getString(key, "");
	}
	public int getInt(Object key){
		return getInt(key, 0);
	}
	public int getInt(Object key, int defaultValue){
		int value;
		try{
			value = ((Integer)get(key)).intValue();
		}catch(Exception e){
			return defaultValue;
		}
		return value;
	}
	public String getString(Object key, String defaultValue){
		String value = "";
		try{
			//value = ((String)get(key)).toString();
			value = String.valueOf(get(key));
		}catch(Exception e){
			return defaultValue;
		}
		return value;
	}
}
